<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //ES6引入rest参数，用于获取函数的参数，用来代表arguments
        //ES5获取实参的方式
        function data() {
            console.log(arguments);
            console.log(arguments);
        }
        data('白芷', '阿娇', '四惠')

        //ES6获取实参的方式
        function date(...args) {
            console.log(args);  //能用filter,some,every,map
        }
        date('白芷', '阿娇', '四惠')

        //rest参数必须放最后
        function fn(a, b, ...args) {
            console.log(a);
            console.log(b);
            console.log(args);
        }
        fn(1, 2, 3, 4, 5, 6)
    </script>
</body>

</html>